/**
 * cc直播插件 app播放调用
 */

// app环境下引入
// #ifdef APP
var ccLiveUniPlugin = uni.requireNativePlugin("Bokecc-CcLiveUniPlugin");
// #endif

/**
 * app进入直播
 */
export const loginLive = (roomId, accountId) => {
	ccLiveUniPlugin.loginLive({
			roomId,
			accountId,
			userName: "",
			password: "",
			// 'viewerCustomUa': _this.viewerCustomUa,
			// 'viewerCustomInfo': _this.viewerCustomInfo,
			// 'disAllowCapture': _this.disAllowCapture ? '1' : '0',
			// 'secondaryVerify': _this.secondaryVerify ? '1' : '0'
		},
		(ret) => {
			let data = JSON.parse(ret);
			uni.hideLoading();
			uni.showToast({
				title: data.msg,
				icon: "none",
			});
			// setTimeout(() => {
			//   _this.loginButtonEnable = true;
			// }, 5000);
		}
	);
};


// app进入回放
export const loginLivePlayBack = (roomId, accountId, recordId) => {
	ccLiveUniPlugin.loginReplay({
		roomId,
		accountId,
		recordId,
		'userName': '',
		'password': '',
		// 'secondaryVerify': this.secondaryVerify ? '1' : '0',
		// 'disAllowCapture': this.disAllowCapture ? '1' : '0'
	}, (ret) => {
		let data = JSON.parse(ret);
		uni.hideLoading();
		uni.showToast({
			title: data.msg,
			icon: "none"
		});
		// setTimeout(() => {
		// 	_this.loginButtonEnable = true;
		// }, 2000);
	})
}